STEP 6: We'll write this function later. Let's build the function that runs until the user enters the correct password.

  • This function has two parameters—the sprite and the password. It'll contain our while loop.
  • In , drag in Define Function with Docstring above where it says: MAIN FUNCTION.
  • Rename my_function to ask_for_password and type text_sprite, password inside the ( ).
  • Finally, change your docstring to the following: """ Gets input until password is correct """

    To navigate the page using the TAB key, first press ESC to exit the code editor.

    # THIS ACTIVITY IS IN PREVIEW ONLY MODE
    • Run Code
    • Submit Work
    • Next Activity
    • Show Console
    • Reset Code Editor
    • Codesters How To (opens in a new tab)